import request from './request.js'

// 登录
const login = function(data) {
	return request({
		url: '/auth/login',
		method: 'POST',
		data: data
	})
}

// 退出登录
const logout = function() {
	return request({
		url: '/auth/logout',
		method: 'DELECT',
	})
}

// 检测版本
const getVersion = function() {
	return request({
		url: '/app/appShow/versions/list',
		method: 'GET',
	})
}

// 基本信息
const getBaseList = function() {
	return request({
		url: '/app/appShow/reservoirBaseInfo/list',
		method: 'GET',
	})
}

// 水情监测
const getrealInfo = function(data) {
	return request({
		url: '/app/appShow/realInfo?stcd=' + data.stcd,
		method: 'GET',
	})
}

// 雨情监测
const queryYLZXX = function(data) {
	return request({
		url: '/app/appShow/queryYLZXX?stcd=' + data.stcd + '&count=' + data.count,
		method: 'GET',
	})
}

// 渗压监测
const getDamVolumeInfo = function(data) {
	return request({
		url: '/app/appShow/selectDamVolumeInfo?dmCode=' + data.dmCode + '&jcTime=' + data.jcTime,
		method: 'GET',
	})
}

// 三个责任人
const getperson = function() {
	return request({
		url: '/app/appShow/person/list',
		method: 'GET',
	})
}

// 待办事件
const getbacklist = function() {
	return request({
		url: '/app/appShow/back/list',
		method: 'GET',
	})
}

// 工程名称、工程类型、工程等别、主坝级别、坝顶高程、特征水位
const getprofilelist = function() {
	return request({
		url: '/app/profile/list',
		method: 'GET',
	})
}

// 查询各设备详细信息
const getdeviceTree = function(data) {
	return request({
		url: '/app/appShow/deviceTree?pid=' + data.pid,
		method: 'GET',
	})
}

// 设备维护保养记录
const getfxyjsbList = function() {
	return request({
		url: '/app/appShow/fxyjsbList',
		method: 'GET',
	})
}

// 查看告警信息
const getalarmInfoList = function() {
	return request({
		url: '/app/appShow/alarmInfo/list',
		method: 'GET',
	})
}

// 获取摄像头列表
const getCameraList = function() {
	return request({
		url: '/app/appShow/getCameraList',
		method: 'GET',
	})
}

// 获取摄像头播放地址
const getWsPreview = function(data) {
	return request({
		url: '/app/appShow/getWsPreview',
		method: 'GET',
		data: data
	})
}
const getHlsPreview = function(data) {
	return request({
		url: '/app/appShow/getHlsPreview',
		method: 'GET',
		data: data
	})
}

// 控制摄像头方向
const getControl = function(data) {
	return request({
		url: '/business/cameras/getControl?cameraCodeIndex=' + data.cameraCodeIndex + '&action=' + data.action + '&command=' + data.command + '&speed=' + data.speed,
		method: 'POST',
		// params: data
	})
}

// 查看工作人员通讯录
const getdutyInfo = function() {
	return request({
		url: '/app/appShow/dutyInfo/list',
		method: 'GET',
	})
}

// 查看个人信息功能
const getuserprofile = function() {
	return request({
		url: '/system/user/profile',
		method: 'GET',
	})
}

// 修改密码功能
const putuserprofile = function(query) {
	return request({
		url: '/system/user/profile/updatePwd?oldPassword=' + query.oldPassword + '&newPassword=' + query.newPassword,
		method: 'PUT',
	})
}

// 水库类别
const re_class = function() {
	return request({
		url: '/system/dict/data/type/re_class',
		method: 'GET',
	})
}

// 水库类型
const re_type = function() {
	return request({
		url: '/system/dict/data/type/re_type',
		method: 'GET',
	})
}

// 主要建筑物级别
const dz_zyjzwjb = function() {
	return request({
		url: '/system/dict/data/type/dz_zyjzwjb',
		method: 'GET',
	})
}

// 主要建筑物级别
const re_gcdb = function() {
	return request({
		url: '/system/dict/data/type/re_gcdb',
		method: 'GET',
	})
}

// 工程规模
const re_gcgm = function() {
	return request({
		url: '/system/dict/data/type/re_gcgm',
		method: 'GET',
	})
}

// 工程规模
const re_use = function() {
	return request({
		url: '/system/dict/data/type/re_use',
		method: 'GET',
	})
}

// 加载行政区划树
const loadTreeData = function() {
	return request({
		url: '/business/xzqh/loadTreeData',
		method: 'GET',
	})
}

// 通讯录
const dutylist = function(data) {
	return request({
		// url: '/app/appShow/dutyInfo/list',
		url: '/app/appShow/user/list?nickName=' + data.nickName,
		method: 'GET',
	})
}

// 查询巡查总任务总览
const gettasklist = function() {
	return request({
		url: '/app/patrol/task/list',
		method: 'GET',
	})
}

// 自动录入巡查基本信息
const addpatrol = function(data) {
	return request({
		url: '/app/patrol/add?taskId=' + data.taskId + '&time=' + data.time,
		method: 'GET',
	})
}
 
// 查询巡查点位
const getpointlist = function(data) {
	return request({
		url: '/app/patrol/point/list?patrolReservoirId=' + data.patrolReservoirId,
		method: 'GET',
	})
}

// 查询巡查基本信息
const reservoirBaseInfo = function(data) {
	return request({
		url: '/app/patrol/reservoirBaseInfo/reservoir?reseId=' + data.reseId,
		method: 'GET',
	})
}

// 查询巡查详情信息
const getparticulars = function(data) {
	return request({
		url: '/app/patrol/particulars/list?partId=' + data.partId,
		method: 'GET',
	})
}

// 查询巡查详情巡查项
const getbuildings = function(data) {
	return request({
		url: '/app/patrol/buildings/list?partId=' + data.partId,
		method: 'GET',
	})
}

// 巡查中更新巡查巡查基本信息
const updateBaseInfo = function(data) {
	return request({
		url: '/app/patrol/reservoirBaseInfo/update',
		method: 'PUT',
		data: data,
	})
}

// 巡查中更新巡查详情信息
const updateparticulars = function(data) {
	return request({
		url: '/app/patrol/particulars/update',
		method: 'PUT',
		data: data,
	})
}

// 巡查中更新巡查详情巡查项状态
const updatebuildings = function(data) {
	return request({
		url: '/app/patrol/buildings/update',
		method: 'PUT',
		data: data,
	})
}

// 结束巡查更新状态判断是完成还是上报
const doneBaseInfo = function(data) {
	return request({
		url: '/app/patrol/reservoirBaseInfo/done',
		method: 'POST',
		data: data,
	})
}

// 增加巡查轨迹 
const addtrack = function(data) {
	return request({
		url: '/app/patrol/track/add',
		method: 'POST',
		data: data
	})
}

// 查询巡查轨迹
const gettracklist = function(data) {
	return request({
		url: '/app/patrol/track/list?reservoirId=' + data.reservoirId,
		method: 'GET',
	})
}

// 图片上传
const uploadCapture = function(data) {
	return request({
		url: '/file/upload',
		method: 'POST',
		data: data
	})
}

// 查询巡查记录
const reservoirlist = function(data) {
	return request({
		url: '/app/patrol/reservoirBaseInfo/list?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
		method: 'GET',
	})
}

// 意见反馈
const addreedback = function(data) {
	return request({
		url: '/app/appShow/reedback/add',
		method: 'POST',
		data: data
	})
}

// 水位库容
const hisRealInfo = function(data) {
	return request({
		url: '/business/stMain/hisRealInfo?stcd=' + data.stcd + '&startTime=' + data.startTime + '&endTime=' + data.endTime,
		method: 'GET',
	})
}

// 年月日降雨量
const queryNYRJYL = function(data) {
	return request({
		url: '/business/stMain/queryNYRJYL?stcd=' + data.stcd,
		method: 'GET',
	})
}

// 日历巡查记录
const statistics = function(data) {
	return request({
		url: '/app/patrol/reservoirBaseInfo/statistics?reseId=' + data.reseId + '&time=' + data.startTime + '&endtime=' + data.endTime,
		method: 'GET',
	})
}

// 巡查次数统计分析
const overdue = function(data) {
	return request({
		url: '/app/patrol/reservoirBaseInfo/overdue?reseId=' + data.reseId + '&time=' + data.startTime + '&endtime=' + data.endTime,
		method: 'GET',
	})
}

// 告警详情
const getalarmInfo = function(data) {
	return request({
		url: '/app/appShow/alarmInfo/warning?warningId=' + data.warningId,
		method: 'GET',
	})
}

// 添加待办
const addinsert = function(data) {
	return request({
		url: '/app/appShow/back/insert',
		method: 'POST',
		data: data
	})
}

// 摄像头报警 
const selectAiData = function(data) {
	return request({
		url: '/business/screenShow/selectAiData',
		method: 'POST',
		data: data
	})
}

// 巡查强制返回
const delectreseId = function(data) {
	return request({
		url: '/app/patrol/reservoirBaseInfo/delect?reseId=' + data.reseId,
		method: 'GET',
	})
}

// 渗压 正常/异常
const selectDam = function(data) {
	return request({
		url: '/app/appShow/selectDamVolume',
		method: 'GET',
	})
}

// 渗压 正常/异常 详情
const selectDamInfo = function(data) {
	return request({
		url: '/app/appShow/selectDamVolumeInfo?remark=' + data.remark + '&dmCode=' + data.dmCode + '&jcTime=' + data.jcTime,
		method: 'GET',
	})
}






export default {
	login,
	logout,
	getVersion,
	getCameraList,
	getBaseList,
	getrealInfo,
	queryYLZXX,
	getDamVolumeInfo,
	getperson,
	getbacklist,
	getprofilelist,
	getdeviceTree,
	getfxyjsbList,
	getalarmInfoList,
	getWsPreview,
	getHlsPreview,
	getdutyInfo,
	getuserprofile,
	putuserprofile,
	getControl,
	re_class,
	re_type,
	dz_zyjzwjb,
	re_gcdb,
	re_gcgm,
	re_use,
	loadTreeData,
	dutylist,
	gettasklist,
	getpointlist,
	addpatrol,
	reservoirBaseInfo,
	getparticulars,
	getbuildings,
	updateBaseInfo,
	updateparticulars,
	updatebuildings,
	doneBaseInfo,
	addtrack,
	gettracklist,
	uploadCapture,
	reservoirlist,
	addreedback,
	hisRealInfo,
	queryNYRJYL,
	statistics,
	overdue,
	getalarmInfo,
	addinsert,
	selectAiData,
	delectreseId,
	selectDam,
	selectDamInfo,
}
